<html>
<head><meta charset="utf-8"><title>Replace our fragile safety scheme around erroneous constant · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html">Replace our fragile safety scheme around erroneous constant</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="195236077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195236077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195236077">(Apr 24 2020 at 19:44)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> <span class="user-mention" data-user-id="120791">@RalfJ</span> is not entirely clear what's left to do here <a href="https://github.com/rust-lang/rust/issues/67191#issuecomment-619064331" title="https://github.com/rust-lang/rust/issues/67191#issuecomment-619064331">https://github.com/rust-lang/rust/issues/67191#issuecomment-619064331</a></p>



<a name="195236153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195236153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195236153">(Apr 24 2020 at 19:45)</a>:</h4>
<p>we were checking with <span class="user-mention" data-user-id="125250">@Wesley Wiser</span> and some code was changed meanwhile you've commented there and the PR was merged</p>



<a name="195236213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195236213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195236213">(Apr 24 2020 at 19:46)</a>:</h4>
<p>please, let me know and I will follow up</p>



<a name="195275631"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195275631" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195275631">(Apr 25 2020 at 08:57)</a>:</h4>
<p>I think we can now remove the code changes in <a href="https://github.com/rust-lang/rust/pull/67134/files#diff-ac4e8531e3b428256ca33fa2bb472440" title="https://github.com/rust-lang/rust/pull/67134/files#diff-ac4e8531e3b428256ca33fa2bb472440">https://github.com/rust-lang/rust/pull/67134/files#diff-ac4e8531e3b428256ca33fa2bb472440</a></p>



<a name="195275646"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195275646" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195275646">(Apr 25 2020 at 08:57)</a>:</h4>
<p>(or just make it <code>delay_span_bug</code>)</p>



<a name="195277414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195277414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195277414">(Apr 25 2020 at 09:48)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> you also mentioned const-prop has to be careful here, which part of const-prop refers that to?</p>



<a name="195277422"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195277422" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195277422">(Apr 25 2020 at 09:49)</a>:</h4>
<p>(I am referring to <a href="https://github.com/rust-lang/rust/pull/67134/files#r355951869" title="https://github.com/rust-lang/rust/pull/67134/files#r355951869">this comment</a>)</p>



<a name="195277537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195277537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195277537">(Apr 25 2020 at 09:51)</a>:</h4>
<p>In particular you said <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=afc895c5754a7963154193ad32702bb1" title="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=afc895c5754a7963154193ad32702bb1">this code errors</a> in const-prop -- which seems odd, it should error in codegen when the constant is actually "used".</p>



<a name="195277588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195277588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195277588">(Apr 25 2020 at 09:52)</a>:</h4>
<p>and indeed I would expect <a href="https://github.com/rust-lang/rust/pull/70820/files#diff-32c57af5c8e23eb048f55d1e955e5cd5R195" title="https://github.com/rust-lang/rust/pull/70820/files#diff-32c57af5c8e23eb048f55d1e955e5cd5R195">this loop to also cover that constant</a></p>



<a name="195279318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195279318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195279318">(Apr 25 2020 at 10:46)</a>:</h4>
<p>well, it does error in const prop because const prop evaluates all <code>Rvalue::Use</code> in order to know the value for the local that is being assigned to, so when the local is referred to again later, we can propagate the constant into the use site of the local</p>



<a name="195279362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195279362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195279362">(Apr 25 2020 at 10:46)</a>:</h4>
<p>const prop <em>doesn't</em> have to be careful anymore, it can now freely eliminate even unevaluated constants as it pleases</p>



<a name="195279366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195279366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195279366">(Apr 25 2020 at 10:46)</a>:</h4>
<p>same goes for other optimizations</p>



<a name="195280525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195280525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195280525">(Apr 25 2020 at 11:18)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195275631" title="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195275631">said</a>:</p>
<blockquote>
<p>I think we can now remove the code changes in <a href="https://github.com/rust-lang/rust/pull/67134/files#diff-ac4e8531e3b428256ca33fa2bb472440" title="https://github.com/rust-lang/rust/pull/67134/files#diff-ac4e8531e3b428256ca33fa2bb472440">https://github.com/rust-lang/rust/pull/67134/files#diff-ac4e8531e3b428256ca33fa2bb472440</a></p>
</blockquote>
<p>that code doesn't exist anymore <a href="https://github.com/rust-lang/rust/blob/0b958790b336738540d027d645718713849638d7/src/librustc_codegen_ssa/mir/constant.rs#L14-L38" title="https://github.com/rust-lang/rust/blob/0b958790b336738540d027d645718713849638d7/src/librustc_codegen_ssa/mir/constant.rs#L14-L38">https://github.com/rust-lang/rust/blob/0b958790b336738540d027d645718713849638d7/src/librustc_codegen_ssa/mir/constant.rs#L14-L38</a></p>



<a name="195280608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195280608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195280608">(Apr 25 2020 at 11:20)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195279362" title="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195279362">said</a>:</p>
<blockquote>
<p>const prop <em>doesn't</em> have to be careful anymore, it can now freely eliminate even unevaluated constants as it pleases</p>
</blockquote>
<p>I don't understand this either, what happens then when you run <code>cargo check</code>? and also is not clear what we should remove from const prop</p>



<a name="195351432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195351432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195351432">(Apr 26 2020 at 20:35)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195280525" title="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195280525">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195275631" title="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195275631">said</a>:</p>
<blockquote>
<p>I think we can now remove the code changes in <a href="https://github.com/rust-lang/rust/pull/67134/files#diff-ac4e8531e3b428256ca33fa2bb472440" title="https://github.com/rust-lang/rust/pull/67134/files#diff-ac4e8531e3b428256ca33fa2bb472440">https://github.com/rust-lang/rust/pull/67134/files#diff-ac4e8531e3b428256ca33fa2bb472440</a></p>
</blockquote>
<p>that code doesn't exist anymore <a href="https://github.com/rust-lang/rust/blob/0b958790b336738540d027d645718713849638d7/src/librustc_codegen_ssa/mir/constant.rs#L14-L38" title="https://github.com/rust-lang/rust/blob/0b958790b336738540d027d645718713849638d7/src/librustc_codegen_ssa/mir/constant.rs#L14-L38">https://github.com/rust-lang/rust/blob/0b958790b336738540d027d645718713849638d7/src/librustc_codegen_ssa/mir/constant.rs#L14-L38</a></p>
</blockquote>
<p>it does: <a href="https://github.com/rust-lang/rust/blob/0b958790b336738540d027d645718713849638d7/src/librustc_codegen_ssa/mir/constant.rs#L54" title="https://github.com/rust-lang/rust/blob/0b958790b336738540d027d645718713849638d7/src/librustc_codegen_ssa/mir/constant.rs#L54">https://github.com/rust-lang/rust/blob/0b958790b336738540d027d645718713849638d7/src/librustc_codegen_ssa/mir/constant.rs#L54</a></p>



<a name="195351484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195351484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195351484">(Apr 26 2020 at 20:36)</a>:</h4>
<p>also there is still a FIXME there, but I am not sure if that is related</p>



<a name="195351506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195351506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195351506">(Apr 26 2020 at 20:37)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195280608" title="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195280608">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195279362" title="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195279362">said</a>:</p>
<blockquote>
<p>const prop <em>doesn't</em> have to be careful anymore, it can now freely eliminate even unevaluated constants as it pleases</p>
</blockquote>
<p>I don't understand this either, what happens then when you run <code>cargo check</code>? and also is not clear what we should remove from const prop</p>
</blockquote>
<p>hm... maybe this can be removed?<br>
<a href="https://github.com/rust-lang/rust/blob/7f3b3df9e2f2efe3434b4f6fc76462d2c8ad332f/src/librustc_mir/transform/const_prop.rs#L470" title="https://github.com/rust-lang/rust/blob/7f3b3df9e2f2efe3434b4f6fc76462d2c8ad332f/src/librustc_mir/transform/const_prop.rs#L470">https://github.com/rust-lang/rust/blob/7f3b3df9e2f2efe3434b4f6fc76462d2c8ad332f/src/librustc_mir/transform/const_prop.rs#L470</a></p>



<a name="195442202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195442202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195442202">(Apr 27 2020 at 16:31)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> <span class="user-mention" data-user-id="124288">@oli</span> to be honest I still have no idea what are we talking about exactly</p>



<a name="195442294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195442294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195442294">(Apr 27 2020 at 16:32)</a>:</h4>
<p><span class="user-mention silent" data-user-id="120791">RalfJ</span> <a href="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195351432" title="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195351432">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195280525" title="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195280525">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195275631" title="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195275631">said</a>:</p>
<blockquote>
<p>I think we can now remove the code changes in <a href="https://github.com/rust-lang/rust/pull/67134/files#diff-ac4e8531e3b428256ca33fa2bb472440" title="https://github.com/rust-lang/rust/pull/67134/files#diff-ac4e8531e3b428256ca33fa2bb472440">https://github.com/rust-lang/rust/pull/67134/files#diff-ac4e8531e3b428256ca33fa2bb472440</a></p>
</blockquote>
<p>that code doesn't exist anymore <a href="https://github.com/rust-lang/rust/blob/0b958790b336738540d027d645718713849638d7/src/librustc_codegen_ssa/mir/constant.rs#L14-L38" title="https://github.com/rust-lang/rust/blob/0b958790b336738540d027d645718713849638d7/src/librustc_codegen_ssa/mir/constant.rs#L14-L38">https://github.com/rust-lang/rust/blob/0b958790b336738540d027d645718713849638d7/src/librustc_codegen_ssa/mir/constant.rs#L14-L38</a></p>
</blockquote>
<p>it does: <a href="https://github.com/rust-lang/rust/blob/0b958790b336738540d027d645718713849638d7/src/librustc_codegen_ssa/mir/constant.rs#L54" title="https://github.com/rust-lang/rust/blob/0b958790b336738540d027d645718713849638d7/src/librustc_codegen_ssa/mir/constant.rs#L54">https://github.com/rust-lang/rust/blob/0b958790b336738540d027d645718713849638d7/src/librustc_codegen_ssa/mir/constant.rs#L54</a></p>
</blockquote>
<p>yeah that code exist but is what causes the error we seem to want, if I remove that line there are not const errors anymore</p>



<a name="195442325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195442325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195442325">(Apr 27 2020 at 16:32)</a>:</h4>
<p>I guess you're talking about something different but I can't understand what you're trying to say</p>



<a name="195629704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195629704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195629704">(Apr 28 2020 at 21:30)</a>:</h4>
<blockquote>
<p>yeah that code exist but is what causes the error we seem to want, if I remove that line there are not const errors anymore</p>
</blockquote>
<p>that's odd, shouldn't wherever we iterate over <code>required_const</code> still report errors?</p>



<a name="195629857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195629857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195629857">(Apr 28 2020 at 21:31)</a>:</h4>
<p>also when you wrote "that code doesn't exist anymore", I dont understand -- all the code that got added in <a href="https://github.com/rust-lang/rust/issues/67134" title="https://github.com/rust-lang/rust/issues/67134">#67134</a> in that file seems to still be there</p>



<a name="195630135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195630135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195630135">(Apr 28 2020 at 21:33)</a>:</h4>
<p><span class="user-mention silent" data-user-id="120791">RalfJ</span> <a href="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195629704" title="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195629704">said</a>:</p>
<blockquote>
<blockquote>
<p>yeah that code exist but is what causes the error we seem to want, if I remove that line there are not const errors anymore</p>
</blockquote>
<p>that's odd, shouldn't wherever we iterate over <code>required_const</code> still report errors?</p>
</blockquote>
<p>ah, that loop actually calls <code>eval_mir_constant</code></p>



<a name="195630262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195630262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195630262">(Apr 28 2020 at 21:35)</a>:</h4>
<p>but then, even before <a href="https://github.com/rust-lang/rust/pull/67134" title="https://github.com/rust-lang/rust/pull/67134">https://github.com/rust-lang/rust/pull/67134</a> we got <em>some</em> const-errors. and that is where this code in <code>eval_mir_constant</code> got added. so that place cannot be the only place where errors are emitted. that means there are at least 2 places, and that should be unnecessary now.</p>



<a name="195630271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195630271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195630271">(Apr 28 2020 at 21:35)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> ^</p>



<a name="195630375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195630375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195630375">(Apr 28 2020 at 21:36)</a>:</h4>
<p>and then there's a FIXME there with <span class="user-mention" data-user-id="124288">@oli</span>'s name in it that got added in <a href="https://github.com/rust-lang/rust/issues/67134" title="https://github.com/rust-lang/rust/issues/67134">#67134</a>, not sure if that was resolved now or not</p>



<a name="195630657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195630657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195630657">(Apr 28 2020 at 21:39)</a>:</h4>
<p><span class="user-mention silent" data-user-id="120791">RalfJ</span> <a href="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195629704" title="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195629704">said</a>:</p>
<blockquote>
<blockquote>
<p>yeah that code exist but is what causes the error we seem to want, if I remove that line there are not const errors anymore</p>
</blockquote>
<p>that's odd, shouldn't wherever we iterate over <code>required_const</code> still report errors?</p>
</blockquote>
<p>yes, that happens here <a href="https://github.com/rust-lang/rust/pull/70820/files#diff-32c57af5c8e23eb048f55d1e955e5cd5R195" title="https://github.com/rust-lang/rust/pull/70820/files#diff-32c57af5c8e23eb048f55d1e955e5cd5R195">https://github.com/rust-lang/rust/pull/70820/files#diff-32c57af5c8e23eb048f55d1e955e5cd5R195</a></p>



<a name="195630760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195630760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195630760">(Apr 28 2020 at 21:40)</a>:</h4>
<p>but we are calling exactly the function that reports the error, so if I remove from there we have no error reporting anymore</p>



<a name="195630844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195630844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195630844">(Apr 28 2020 at 21:40)</a>:</h4>
<p><span class="user-mention silent" data-user-id="120791">RalfJ</span> <a href="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195629857" title="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195629857">said</a>:</p>
<blockquote>
<p>also when you wrote "that code doesn't exist anymore", I dont understand -- all the code that got added in <a href="https://github.com/rust-lang/rust/issues/67134" title="https://github.com/rust-lang/rust/issues/67134">#67134</a> in that file seems to still be there</p>
</blockquote>
<p>I'm not sure what parts are we talking about, <a href="https://github.com/rust-lang/rust/pull/67134/files#diff-ac4e8531e3b428256ca33fa2bb472440R53" title="https://github.com/rust-lang/rust/pull/67134/files#diff-ac4e8531e3b428256ca33fa2bb472440R53">https://github.com/rust-lang/rust/pull/67134/files#diff-ac4e8531e3b428256ca33fa2bb472440R53</a> this is not there anymore</p>



<a name="195630880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195630880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195630880">(Apr 28 2020 at 21:41)</a>:</h4>
<p>maybe is better if you point to the code in master that you're talking about?</p>



<a name="195630980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195630980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195630980">(Apr 28 2020 at 21:42)</a>:</h4>
<p>was commenting meanwhile I was reading, now I see that you saw that the loop calls <code>eval_mir_constant</code> :)</p>



<a name="195631101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195631101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195631101">(Apr 28 2020 at 21:43)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> this <a href="https://github.com/rust-lang/rust/blob/b7bd7c1024a1449449c3ae7b4b4c63a904a620e6/src/librustc_codegen_ssa/mir/constant.rs#L22-L23" title="https://github.com/rust-lang/rust/blob/b7bd7c1024a1449449c3ae7b4b4c63a904a620e6/src/librustc_codegen_ssa/mir/constant.rs#L22-L23">https://github.com/rust-lang/rust/blob/b7bd7c1024a1449449c3ae7b4b4c63a904a620e6/src/librustc_codegen_ssa/mir/constant.rs#L22-L23</a> is what we have in master</p>



<a name="195631117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195631117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195631117">(Apr 28 2020 at 21:43)</a>:</h4>
<p>but the FIXME seems unrelated to my changes</p>



<a name="195631202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195631202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195631202">(Apr 28 2020 at 21:44)</a>:</h4>
<p>I meant, I see the general idea you're mentioning here that we may be reporting things from different places and you want to unify :)</p>



<a name="195633040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195633040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195633040">(Apr 28 2020 at 21:59)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195630844" title="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195630844">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="120791">RalfJ</span> <a href="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195629857" title="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195629857">said</a>:</p>
<blockquote>
<p>also when you wrote "that code doesn't exist anymore", I dont understand -- all the code that got added in <a href="https://github.com/rust-lang/rust/issues/67134" title="https://github.com/rust-lang/rust/issues/67134">#67134</a> in that file seems to still be there</p>
</blockquote>
<p>I'm not sure what parts are we talking about, <a href="https://github.com/rust-lang/rust/pull/67134/files#diff-ac4e8531e3b428256ca33fa2bb472440R53" title="https://github.com/rust-lang/rust/pull/67134/files#diff-ac4e8531e3b428256ca33fa2bb472440R53">https://github.com/rust-lang/rust/pull/67134/files#diff-ac4e8531e3b428256ca33fa2bb472440R53</a> this is not there anymore</p>
</blockquote>
<p>uh, yes it is? I linked to it above, it is right here:<br>
<a href="https://github.com/rust-lang/rust/blob/0b958790b336738540d027d645718713849638d7/src/librustc_codegen_ssa/mir/constant.rs#L54" title="https://github.com/rust-lang/rust/blob/0b958790b336738540d027d645718713849638d7/src/librustc_codegen_ssa/mir/constant.rs#L54">https://github.com/rust-lang/rust/blob/0b958790b336738540d027d645718713849638d7/src/librustc_codegen_ssa/mir/constant.rs#L54</a></p>



<a name="195633056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195633056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195633056">(Apr 28 2020 at 21:59)</a>:</h4>
<p>just got re-formatted a bit</p>



<a name="195633072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195633072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195633072">(Apr 28 2020 at 21:59)</a>:</h4>
<p>we now repeated this exact conversation with the same links twice</p>



<a name="195633091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195633091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195633091">(Apr 28 2020 at 21:59)</a>:</h4>
<p>I feel like in groundhog day</p>



<a name="195633159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195633159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195633159">(Apr 28 2020 at 22:00)</a>:</h4>
<p>so maybe let's make sure we understand why we disagree about whether some piece of code still exists, before going on^^</p>



<a name="195633341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195633341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195633341">(Apr 28 2020 at 22:01)</a>:</h4>
<p>I am talking specifically about the <code>span_err(constant.span, "erroneous constant encountered")</code></p>



<a name="195633363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195633363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195633363">(Apr 28 2020 at 22:01)</a>:</h4>
<p>it got added in that PR, and it is still around</p>



<a name="195633559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195633559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195633559">(Apr 28 2020 at 22:03)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195631202" title="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195631202">said</a>:</p>
<blockquote>
<p>I meant, I see the general idea you're mentioning here that we may be reporting things from different places and you want to unify :)</p>
</blockquote>
<p>yes. previously we had to report errors from consts in a bunch of places to make sure we dont forget a const. now we have that loop over <code>required_consts</code> that takes care of that. so some of those places should be unnecessary now, and we should be able to clean them up.</p>



<a name="195633725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195633725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195633725">(Apr 28 2020 at 22:04)</a>:</h4>
<p><code>eval_mir_constant</code> in codegen is probably the most sensible place for such errors to be reported, this is where monomorphization happens... but then likely it should be the <em>only</em> place, and given how recently it was added, I doubt it currently is the only place.</p>



<a name="195647463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195647463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195647463">(Apr 29 2020 at 00:51)</a>:</h4>
<p><span class="user-mention silent" data-user-id="120791">RalfJ</span> <a href="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195633559" title="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195633559">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195631202" title="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195631202">said</a>:</p>
<blockquote>
<p>I meant, I see the general idea you're mentioning here that we may be reporting things from different places and you want to unify :)</p>
</blockquote>
<p>yes. previously we had to report errors from consts in a bunch of places to make sure we dont forget a const. now we have that loop over <code>required_consts</code> that takes care of that. so some of those places should be unnecessary now, and we should be able to clean them up.</p>
</blockquote>
<p>But isn't the loop over <code>required_consts</code> in <code>librustc_codegen_ssa</code>? We want to eagerly report errors where we can otherwise users will see <code>cargo check</code> pass and then <code>cargo build</code> fail with errors.</p>



<a name="195746120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195746120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195746120">(Apr 29 2020 at 17:47)</a>:</h4>
<p>we had codegen-time const errors before, too. so there must now be at least two places in codegen than emit such errors: <code>eval_mir_constant</code> and where it was done before</p>



<a name="195746235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195746235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195746235">(Apr 29 2020 at 17:48)</a>:</h4>
<p>also <span class="user-mention" data-user-id="125250">@Wesley Wiser</span> when we emit such errors from optimizations, <code>cargo check</code> might not show them either if it doesnt run optimizations</p>



<a name="195746268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195746268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195746268">(Apr 29 2020 at 17:49)</a>:</h4>
<p>I dont think "randomly sprinkle const-error-emitting code all over the place" is a sustainable strategy for avoiding <code>check</code> vs <code>build</code> mismatches</p>



<a name="195746589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195746589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195746589">(Apr 29 2020 at 17:51)</a>:</h4>
<p>I completely agree with you there! I just want to make sure we don't accidentally regress <code>check</code> functionality from how it works today.</p>



<a name="195796912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195796912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195796912">(Apr 30 2020 at 04:11)</a>:</h4>
<p>Ohh this is interesting.<br>
So if I understood this correctly: </p>
<p>Say we introduced new functionality in <code>const-prop</code> that detects errors at compile time just by function of it having the ability of e.g. detecting when you're computing <code>1/0</code> with constant values.</p>
<p>Then, <code>cargo check</code> must also gain that ability. Lest it had less detecting capabilities than <code>cargo build</code> does.<br>
Did I get you right, <span class="user-mention" data-user-id="120791">@RalfJ</span>?</p>



<a name="195796972"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195796972" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195796972">(Apr 30 2020 at 04:13)</a>:</h4>
<p>Because if I did, I have to now ask: what do we do in that scenario? Because that's precisely what we just added to const-prop like yesterday.</p>
<p>(<strong>Note</strong>: the analysis is not yet complete. We're able to find more unescapable panics than before, but not all of the ones we would be able to)</p>



<a name="195802841"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195802841" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195802841">(Apr 30 2020 at 06:41)</a>:</h4>
<p><span class="user-mention" data-user-id="212698">@Félix Fischer</span> well, it's not a "must" -- already today, we have discrepancies between <code>cargo check</code>, <code>cargo build</code>, <code>cargo build --release</code>. It's not great but it happens.</p>



<a name="195802855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195802855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195802855">(Apr 30 2020 at 06:41)</a>:</h4>
<p>I had an example once, not sure if I can find it again...</p>



<a name="195802914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195802914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195802914">(Apr 30 2020 at 06:42)</a>:</h4>
<p>see <a href="https://github.com/rust-lang/rust/issues/70923" title="https://github.com/rust-lang/rust/issues/70923">https://github.com/rust-lang/rust/issues/70923</a> for example</p>



<a name="195802976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195802976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195802976">(Apr 30 2020 at 06:43)</a>:</h4>
<p>I think the debug vs release one that I knew of has been fixed</p>



<a name="195822360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195822360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195822360">(Apr 30 2020 at 10:45)</a>:</h4>
<p>Also, <code>cargo check</code> queries for <code>optimized_mir</code> so const-prop is always run.</p>



<a name="195839316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195839316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195839316">(Apr 30 2020 at 13:37)</a>:</h4>
<p>Woah! that's awesome, <span class="user-mention" data-user-id="125250">@Wesley Wiser</span> <br>
<code>cargo check</code> is OP.</p>



<a name="195902147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195902147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195902147">(Apr 30 2020 at 21:12)</a>:</h4>
<p>anyway, let's go back to the const-checking cleanup thing</p>



<a name="195902165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195902165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195902165">(Apr 30 2020 at 21:12)</a>:</h4>
<p>I think we are blocked on <span class="user-mention" data-user-id="124288">@oli</span> answering the open questions around where there might still be stuff to clean up... (in particular around the FIXME added by <a href="https://github.com/rust-lang/rust/pull/67134" title="https://github.com/rust-lang/rust/pull/67134">https://github.com/rust-lang/rust/pull/67134</a>)</p>



<a name="195902239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195902239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195902239">(Apr 30 2020 at 21:13)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> you didn't respond to <a href="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195633040" title="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195633040">my last responses to what you wrote</a></p>



<a name="195903161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195903161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195903161">(Apr 30 2020 at 21:20)</a>:</h4>
<p>After grepping a bit I think I came to the conclusion that <em>all</em> the "erroneous constant" errors we saw before <a href="https://github.com/rust-lang/rust/pull/67134" title="https://github.com/rust-lang/rust/pull/67134">https://github.com/rust-lang/rust/pull/67134</a> actually come from const_prop; <span class="user-mention" data-user-id="124288">@oli</span> is that right?</p>



<a name="195903265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195903265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195903265">(Apr 30 2020 at 21:21)</a>:</h4>
<p><span class="user-mention silent" data-user-id="120791">RalfJ</span> <a href="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195902239" title="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195902239">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> you didn't respond to <a href="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195633040" title="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195633040">my last responses to what you wrote</a></p>
</blockquote>
<p>hey, sorry and thanks for your help at the same time</p>



<a name="195903281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195903281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195903281">(Apr 30 2020 at 21:21)</a>:</h4>
<p>couldn't read any this stuff yet, gonna check all this again as soon as possible, unsure if I will be able today</p>



<a name="195903868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195903868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195903868">(Apr 30 2020 at 21:26)</a>:</h4>
<p>so I think I have two concrete questions/cleanups:</p>
<ul>
<li>what about <a href="https://github.com/rust-lang/rust/blob/be8589fc31162bb71b0f765beba6ce73ec8ba93a/src/librustc_codegen_ssa/mir/constant.rs#L22" title="https://github.com/rust-lang/rust/blob/be8589fc31162bb71b0f765beba6ce73ec8ba93a/src/librustc_codegen_ssa/mir/constant.rs#L22">the FIXME</a>?</li>
<li>can we remove <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_mir/transform/const_prop.rs#L423-L431" title="https://github.com/rust-lang/rust/blob/master/src/librustc_mir/transform/const_prop.rs#L423-L431">all this now</a>? It makes no sense that const_prop would do all sorts of error handling for consts that other optimizations wouldn't do.</li>
</ul>



<a name="195903911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195903911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195903911">(Apr 30 2020 at 21:27)</a>:</h4>
<p>also the error raised by const_prop and codegen is a bit different ("erroneous constant used" vs "erroneous constant encountered")</p>



<a name="195941040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195941040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195941040">(May 01 2020 at 08:32)</a>:</h4>
<p>The advantage of reporting errors in const prop over leaving it to the fallback scheme is that the fallback scheme only triggers during monomorphization</p>



<a name="195941099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195941099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195941099">(May 01 2020 at 08:32)</a>:</h4>
<p>So I don't think we should remove <a href="https://github.com/rust-lang/rust/blob/bd0bacc694d7d8175804bb6f690cb846bfa4a9ee/src/librustc_mir/transform/const_prop.rs#L418" title="https://github.com/rust-lang/rust/blob/bd0bacc694d7d8175804bb6f690cb846bfa4a9ee/src/librustc_mir/transform/const_prop.rs#L418">https://github.com/rust-lang/rust/blob/bd0bacc694d7d8175804bb6f690cb846bfa4a9ee/src/librustc_mir/transform/const_prop.rs#L418</a> even if we can</p>



<a name="195941139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195941139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195941139">(May 01 2020 at 08:33)</a>:</h4>
<p>O_o I think <a href="https://github.com/rust-lang/rust/blob/be8589fc31162bb71b0f765beba6ce73ec8ba93a/src/librustc_codegen_ssa/mir/constant.rs#L22" title="https://github.com/rust-lang/rust/blob/be8589fc31162bb71b0f765beba6ce73ec8ba93a/src/librustc_codegen_ssa/mir/constant.rs#L22">https://github.com/rust-lang/rust/blob/be8589fc31162bb71b0f765beba6ce73ec8ba93a/src/librustc_codegen_ssa/mir/constant.rs#L22</a> is dead code</p>



<a name="195941203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195941203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195941203">(May 01 2020 at 08:34)</a>:</h4>
<p>we should be able to change the entire function body to <a href="https://github.com/rust-lang/rust/blob/be8589fc31162bb71b0f765beba6ce73ec8ba93a/src/librustc_codegen_ssa/mir/constant.rs#L33-L35" title="https://github.com/rust-lang/rust/blob/be8589fc31162bb71b0f765beba6ce73ec8ba93a/src/librustc_codegen_ssa/mir/constant.rs#L33-L35">https://github.com/rust-lang/rust/blob/be8589fc31162bb71b0f765beba6ce73ec8ba93a/src/librustc_codegen_ssa/mir/constant.rs#L33-L35</a></p>



<a name="195955857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195955857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195955857">(May 01 2020 at 12:26)</a>:</h4>
<p>finally catched up with this now</p>



<a name="195955863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195955863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195955863">(May 01 2020 at 12:26)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195941139" title="#narrow/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant/near/195941139">said</a>:</p>
<blockquote>
<p>O_o I think <a href="https://github.com/rust-lang/rust/blob/be8589fc31162bb71b0f765beba6ce73ec8ba93a/src/librustc_codegen_ssa/mir/constant.rs#L22" title="https://github.com/rust-lang/rust/blob/be8589fc31162bb71b0f765beba6ce73ec8ba93a/src/librustc_codegen_ssa/mir/constant.rs#L22">https://github.com/rust-lang/rust/blob/be8589fc31162bb71b0f765beba6ce73ec8ba93a/src/librustc_codegen_ssa/mir/constant.rs#L22</a> is dead code</p>
</blockquote>
<p>going to remove this code</p>



<a name="195955871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195955871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195955871">(May 01 2020 at 12:26)</a>:</h4>
<p>but then it seems the only thing we are able to do right now?</p>



<a name="195955892"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195955892" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195955892">(May 01 2020 at 12:27)</a>:</h4>
<p>yes, I believe so</p>



<a name="195956271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195956271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195956271">(May 01 2020 at 12:32)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/71747" title="https://github.com/rust-lang/rust/issues/71747">#71747</a></p>



<a name="195956285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Replace%20our%20fragile%20safety%20scheme%20around%20erroneous%20constant/near/195956285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Replace.20our.20fragile.20safety.20scheme.20around.20erroneous.20constant.html#195956285">(May 01 2020 at 12:32)</a>:</h4>
<p>ui tests are <span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span>, let's see what ci says</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>